Clock selection circuit and test clock generation circuit for LBIST and ATPG test circuit

ABSTRACT

A test circuit is operable in ATPG mode and LBIST mode. The test circuit includes a clock selection circuit. The clock selection circuit includes clock logic circuitry to receive an LBIST mode signal and an ATPG mode signal and to generate an indication of whether the test circuit is operating in either the ATPG mode or the LBIST mode, a multiplexing circuit to receive an ATPG clock and a functional clock as input and output a selected one of the ATPG clock and the functional clock, and a clock gate circuit enabled in response to enable signals. The enable signals are an inverse of a selected one of the ATPG clock and the functional clock. The clock gate circuit receives the indication of whether the test circuit is operating in either the ATPG mode or the LBIST mode and generates a test clock as a function of the indication.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No. 15/268,848 filed Sep. 19, 2016, the disclosure of which is incorporated by reference.

TECHNICAL FIELD

This disclosure is related to the field of test circuits for integrated circuits and, more particularly, to clock selection and test clock generation circuits for test circuits capable of operating in both logic built-in self-test (LBIST) and automatic test pattern generation (ATPG) modes.

BACKGROUND

Despite advances in semiconductor processing and manufacturing technology, integrated circuits are manufactured with errors. Unfortunately, a single error can render an integrated circuit unusable. Accordingly, various techniques to identify faults in integrated circuits have been developed.

Two leading strategies used to test integrated circuit logic are automatic test pattern generation (ATPG) and logic built-in self-test (LBIST). ATPG works by applying patterns from an external tester and observing the results. BIST works by sending out test patterns generated by a pseudorandom pattern generator along scan chains and then collecting the responses in a multiple-input signature register (MISR). The final content of the MISR is a signature that determines the pass/fail result. The signature is typically compared to a pre-calculated, or expected, signature.

A clock different than the clock used by the integrated circuit during normal, functional operation is typically used when in a test mode. In fact, BIST uses one test clock, and ATPG mode uses two separate test clocks.

Glitches can occur during the process of switching the integrated circuit over from the functional clock to one of the test clocks, or from one test clock to another test clock. Circuitry capable of generating the test clocks to be used, and which is capable of switching between the various clocks in a glitch free fashion, is therefore desirable.

SUMMARY

This summary is provided to introduce a selection of concepts that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used as an aid in limiting the scope of the claimed subject matter.

Disclosed herein is a test circuit operable in an automatic test pattern generation (ATPG) mode and a logic built-in self-test (LBIST) mode. The test circuit includes a clock selection circuit. The clock selection circuit includes clock logic circuitry configured to receive an LBIST mode signal and an ATPG mode signal and to generate an indication of whether the test circuit is operating in either the ATPG mode or the LBIST mode, a multiplexing circuit configured to receive an ATPG clock and a functional clock as input and output a selected one of the ATPG clock and the functional clock, and a clock gate circuit enabled in response to enable signals. The enable signals are an inverse of a selected one of the ATPG clock and the functional clock. The clock gate circuit receives the indication of whether the test circuit is operating in either the ATPG mode or the LBIST mode and is configured to generate a test clock as a function of the indication.

The clock logic circuitry includes a clock logic circuitry OR gate configured to receive the LBIST mode signal and the ATPG mode signal and generate a clock logic circuitry OR gate output, and a clock logic circuitry AND gate configured to receive a functional clock enable signal and an inverse of the clock logic circuitry OR gate output.

The test circuit includes a clock generation circuit configured to generate the ATPG clock, wherein the clock generation circuit is operable in a reset phase, a shift mode, and a capture mode. The clock generation circuit includes a first circuit configured to perform a reset sequence in the reset phase, pass a shift clock for use in the shift mode, and to pass a PLL clock for use in the capture mode.

The first circuit includes a first circuit first OR gate configured to receive a stuck-at ATPG signal, a scan enable signal, and a shift clock pass signal, and to generate a first OR output, a third clock gate circuit, and a fourth clock gate circuit. The third clock gate circuit has a third clock gate data input configured to receive the first OR output and a third clock gate enable input configured to receive the shift clock, and is further configured to generate a third clock gate output. The fourth clock gate circuit has a fourth clock gate data input configured to receive an inverse of the first OR output and a fourth clock gate enable input configured to receive the PLL clock, the fourth clock gate circuit configured to generate a fourth clock gate output. A first circuit second OR gate is configured to receive the third and fourth clock gate outputs.

The stuck-at ATPG signal indicates that the clock generation circuit is to test for stuck-at faults, and the scan enable signal indicates whether the clock generation circuit is in the shift mode or the capture mode.

The ATPG mode signal represents an output of a logical OR between the stuck-at ATPG signal and an at-speed ATPG signal. The at-speed ATPG signal indicates that the clock generation circuit is to test for timing faults.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a schematic block diagram of a first portion of a clock selection circuit in accordance with this disclosure.

FIG. 1B is a schematic block diagram of a second portion of the clock selection circuit in accordance with this disclosure.

FIG. 2 is a schematic block diagram of clock gate circuits used in the clock selection circuit of FIG. 1B.

FIG. 3A is a schematic block diagram of a first portion of an ATPG clock generation circuit in accordance with this disclosure.

FIG. 3B is a schematic block diagram of a second portion of an ATPG clock generation circuit in accordance with this disclosure.

FIG. 3C is a schematic block diagram of a third portion of an ATPG clock generation circuit in accordance with this disclosure.

FIG. 4 is a schematic block diagram of clock gate circuits used in the clock generation circuits of FIG. 3A-3C.

FIG. 5 is a timing diagram of output of the clock selection circuit in operation.

FIG. 6 is a timing diagram of the ATPG clock generation circuit in operation.

DETAILED DESCRIPTION

One or more embodiments of the present disclosure will be described below. These described embodiments are only examples of the presently disclosed techniques. Additionally, in an effort to provide a concise description, all features of an actual implementation may not be described in the specification.

When introducing elements of various embodiments of the present disclosure, the articles “a,” “an,” and “the” are intended to mean that there are one or more of the elements. The terms “comprising,” “including,” and “having” are intended to be inclusive and mean that there may be additional elements other than the listed elements. Additionally, it should be understood that references to “one embodiment” or “an embodiment” of the present disclosure are not intended to be interpreted as excluding the existence of additional embodiments that also incorporate the recited features. Furthermore, where an electronic component is referred to as having an “inverting input” or “inverting terminal”, this is not intended to mean that the electronic component must perform the inverting function itself, and may instead in some cases mean that the signal to be fed to that input may be fed through an inverter prior to entry into the electronic component. Like reference numbers in the drawing figures refer to like elements throughout.

Depicted in FIGS. 1A-1B is a block diagram of an electronic device 99. The device 99 may be suitably implemented in an integrated circuit having one or more integrated circuit dies. Such integrated circuit dies are typically manufactured in wafers (not shown) and subsequently tested while still in the wafer form using a combination of ATPG and LBIST testing within each integrated circuit in the wafer as a system. External automated test equipment (ATE) is used during the ATPG testing, for example, for forcing certain signals to certain logic values.

The device 99 includes a clock selection circuit 100 for selecting and providing a clock CP to the device 99 for use in functional operation as well as during ATPG and LBIST operations. The clock selection circuit 100 includes clock logic circuitry 101 receiving as input a LBIST mode signal (indicating operation in LBIST mode is to occur) and an ATPG mode signal (indicating operation in ATPG mode is to occur, where ATPG mode is a logical OR between Stuck-at ATPG and At-speed ATPG signals, which represent different ATPG modes in which the device 99 can operate), and providing as output a first data output and a second data output, to a clock gate circuit 118. Assertion of the Stuck-at ATPG signal would indicate that the device 99 is to test for stuck-at faults, and assertion of the at-speed ATPG signal would indicate that the device 99 is to test for timing faults.

In greater detail, the clock logic circuit 101 includes an OR gate 114 receiving as input the LBIST mode signal from a self-test control unit (STCU) 110 and the ATPG mode signal from a test control unit (TCU) 112. The STCU and TCU may be separate components, or in some cases may be a single component. The OR gate 114 provides output through inverter 115 to AND gates 116 a-116 i. The AND gates 116 a-116 i also receive as input a Function Enable signal from a function enable block 108. The Function Enable signal is a multi-bit bus signal, with each bit of Function Enable corresponding to a bit of MC Clk, and indicating whether that bit of MC Clk will be available at CP when device 99 is operating in functional mode. If the Function Enable signal is ‘1’, the MC_clk bit will be available at CP, else CP will be ‘0’. Where ATPG mode=‘1’, the device 99 is operating in ATPG mode, and where ATPG mode=‘0’ and LBIST mode=‘1’, the device 99 is operating in LBIST mode. When both ATPG mode=‘0’ and LBIST mode=‘0’, the device 99 is operating in functional mode.

A multiplexing circuit 103 provides a functional clock signal or an ATPG clock signal as an enable output to the clock gate circuit 118. The test multiplexing circuit 120 within multiplexing circuit 103 provides an LBIST clock signal or the ATPG clock signal as a test clock output to the clock gates 118 a-118 i. The ATPG clock signal and LBIST clock signal are both multi-bit busses.

The multiplexing circuit 103 includes a system multiplexer 102, first auxiliary multiplexer 104, and second auxiliary multiplexer 106. The multiplexers 102, 104, 106 receive as input the ATPG clock[2] and the functional clock, and pass the selected clock to the enable inputs of the latches in the clock gates 118 a-118 i, as will be explained below. The multiplexers 102, 104, 106 perform selection as a function of receipt of the ATPG mode signal. Where the functional clock is selected, the dividers (/2) and (/4) are activated and the functional clock is passed therethrough.

As depicted, MC Clk is a bus where MC Clk[0] is the clk_320_sys signal, MC Clk[1] is the clk_160_sys signal, MC Clk[2] is the clk_80_sys signal, MC Clk[3] is the clk_320_aux0 signal, MC Clk[4] is the clk_160_aux0 signal, MC Clk[5] is the clk_80_aux0 signal, MC Clk[6] is the clk_320_aux1 signal, MC Clk[7] is the clk_160_aux1 signal, and MC Clk[8] is the clk_80 aux1 signal. Output of the system multiplexer 102 in the form of the MC Clk[0] signal (CLK 320 sys) is also fed to a clock input of the STCU 110.

The multiplexing circuit 103 includes a test multiplexer circuit 120 controlled by the ATPG mode signal received from the TCU 112 and the LBIST mode signal received from the STCU 110. The test multiplexer circuit 120 outputs a selected clock, such as the ATPG clock (from the clock generation circuits 200 a-200 c) or LBIST clock (from the LBIST controller 134), to the clock gate circuits 118 a-118 i.

The clock gate circuits 118 a-118 i, as shown in FIG. 2, include first and second latches 150 and 152, first and second AND gates 154 and 156, and an OR gate 158. The latch 150 receives at its data input the respective output FE Gated[n] from a corresponding AND gate 116 a-116 i, and at its inverting enable input the selected clock from MC Clk[n]. The AND gate 154 receives as input the output from the latch 150 and a non-inverted version of the selected clock from MC Clk[n]. The latch 152 receives at its data input the output Test Mode from OR gate 114, and at its inverting enable the selected clock from MC Clk[n]. The AND gate 156 receives as input the output from the latch 152 and the selected Test Clock[n] from the test muxes. The OR gate 158 receives as input the outputs from the AND gates 154 and 156, and provides the clock output CP at its output.

Operation of the clock selection block 100 will now be described. Prior to entry into ATPG mode, the clock selection block 100 serves to output the functional clock. To that end, the ATPG mode signal is not asserted (indicating that the device 99 is not in ATPG mode), causing selection and output of the functional clock by the multiplexers 102, 104, 106. Since the device 99 is not operating in ATPG mode or in LBIST mode, the function enable block 108 serves to output respective asserted Function Enable[n] signals to the AND gates 116 a-116 i. As previously explained, the Function Enable[n] signals can be ‘1’ or ‘0’. The function enable block 108 is driven by set of programming registers which default to being asserted after power-up of the device 99, but later can be programmed by a CPU to assert or deassert. Since both the ATPG mode signal and LBIST mode signal are low at this point, the OR gate 114 output is deasserted. The AND gates 116 a-116 i will then assert their outputs to the first data input of their respective clock gate circuit 118 a-118 i, and each coupled MC Clk[n] bit will pass the functional clock to the first enable input of its respective clock gate circuit 118 a-118 i, resulting in the clock gate circuits 118 a-118 i outputting CP as following the functional clock.

When the device 99 enters ATPG mode, the ATPG Mode signal is asserted, causing selection of the ATPG clock by the multiplexers 102, 104, 106, as well as the test multiplexer 120. Since the ATPG Mode signal is high, the OR gate 114 will assert its output, resulting in the AND gates 116 a-116 i deasserting their outputs, with the result being that the latches 150 do not assert their outputs regardless of the value of ATPG clock. However, the latches 152 will receive the asserted output of the OR gate 114 at their data inputs, thus their outputs will be asserted regardless of the value of ATPG clock. Therefore, AND gate 156 will pass ATPG clock coming from test MUX 120 to OR gate 158, which outputs the ATPG clock signal as CP[n].

When the device 99 enters LBIST mode, the LBIST Mode signal is asserted, causing selection of the LBIST clock by the test multiplexers 120. The multiplexers 102, 104, and 106 continue to select the functional clock. Since the LBIST Mode signal is high, the OR gate 114 will assert its output, resulting in the AND gates 116 a-116 i deasserting their outputs, with the result being that the latches 150 do not assert their output regardless of the value of functional clock (as functional clock here is the enable of latches 150 and 152). However, the latches 152 will receive the asserted output of the OR gate 114 at their data inputs, thus their output will be asserted regardless of the value of functional clock. As a result, AND gate 156 will pass LBIST clock coming from testmux 120 to OR gate 158, which output the LBIST clock as CP[n].

Shown in FIG. 5 is a timing diagram of operation of the clock selection block 100. CP1 and CP2 in FIG. 5 represent the outputs of AND gates 154 and 156, and CP[n] represents the generated ATPG or LBIST clock (CP[n] is ATPG clock when ATPG mode=‘1’, and LBIST clock when ATPG mode=‘0’ and LBIST mode=‘1’). As can be seen, the switchover of the ATPG or LBIST clock when test mode is enabled and disabled is glitch free. Of note in FIG. 5 is that this timing diagram depicts entry into LBIST mode from functional mode, and exit from LBIST mode to functional mode. This is a pessimistic case for proper operation, as it occurs where the functional clock is based on the signal from PLL clock, as LBIST controller 134 is clocked by the functional clock, and thus the LBIST controller 134 is capable of providing the LBIST clock on the next functional clock pulse. Entry from functional mode to ATPG mode, and exit from ATPG mode back to functional mode is a switchover less prone to errors than entry into and exit from LBIST mode since Scan Enable will be high and thus shift clock can be forced low at that time. Similarly, when ATPG mode is exited, Scan Enable will also be high, so ATPG Clock at this time will follow shift clock and be zero.

Depicted in FIGS. 3A-3C are the clock generation circuits 200 a-200 c. The clock generation circuits 200 a-200 c include first circuits 201 a-201 c receiving as input a Stuck-at ATPG signal (indicating the test clock suitable for finding stuck-at errors it to be used in ATPG mode) and scan enable signal (indicating whether the ATPG operation is operating in shift mode or capture mode) from an ATE, and a control signal from second circuits 203 a-203 c. The first circuits 201 a-201 c also receive a shift clock signal from the ATE. The first circuit 201 a receives a phase locked loop (PLL) clock signal from a PLL in the device 99, the first circuit 201 b receives a PLL/2 clock signal from a /2 divider, and the first circuit 201 c receives a PLL/4 clock signal from a /4 divider. The first circuits 201 a-201 c generate clock signals PBSU CLK at their outputs.

Clock gate circuits 216 a-216 c receive output of the first circuits 201 a-201 c at their enable inputs, receive the ATPG mode signal at their data inputs, and provide their outputs to state machines 218 a-281 c.

Second circuits 203 a-203 c receive multiple inputs from the state machines 218 a-218 c, as well as the Scan Enable signal and the Stuck-at ATPG signal. The second circuits 203 a-203 c generate the ATPG Clock at their outputs.

In greater detail, the first circuits 201 a-201 c include OR gates 202 a-202 c receiving as input the Scan Enable signal, and an inverted version of the control signal output from the second circuits 203 a-203 c. Flip flops 204 a-204 c receive output of the OR gates 202 a-202 c at their data inputs. Flip flop 204 a receives the PLL clock at its clock input, flip flop 204 b receives the PLL/2 clock at its clock input, and flip flop 204 c receives the PLL/4 clock at its clock input. Flip flops 206 a-206 c receive output of the flip flops 204 a-204 c at their data inputs. Flip flop 206 a receives the PLL clock at its clock input, flip flop 206 b receives the PLL/2 clock at its clock input, and flip flop 206 c receives the PLL/4 clock at its clock input. OR gates 208 a-208 c receive as input the Stuck-at ATPG signal, the Scan Enable signal, and output from the flip flops 206 a-206 c. Clock gate circuits 210 a-210 c receive non-inverted output from the OR gates 208 a-208 c at their data inputs, and the shift clock at their enable inputs.

Clock gate circuit 212 a receives inverted output from the OR gate 208 a at its data input, and the PLL clock at its enable input. Clock 212 b receives inverted output from the OR gate 208 b at its data input, and the PLL clock/2 at its enable input. Clock 212 c receives inverted output from the OR gate 208 c at its data input, and the PLL clock/4 at its enable input.

The clock gate circuits 210 a-210 c and 212 a-212 c provide output to the OR gates 214 a-214 c, which in turn provide their outputs as the clock signal PBSU CLK. The clock gate circuits 216 a-216 c receive the clock signal PBSU CLK at their enable inputs, and the ATPG Mode signal at their data inputs.

The second circuits 203 a-203 c include flip flops 220 a-220 c receiving output from the state machines 218 a-218 c at their data inputs, clock inputs from PBSU CLK, and provide their outputs as control signals to the OR gates 202 a-202 c. The second circuits 203 a-203 c also include OR gates 222 a-222 c that receives as input enable signals PBSU Enable from the state machines 218 a-218 c, the Scan Enable signal, and the Stuck-at ATPG signal. Clock gates 224 a-224 c receive output from the OR gates 222 a-222 c at their data inputs, the clock signals PBSU CLK at their enable inputs, and provide their output as the ATPG Clock[n] bits.

The clock gate circuits 210 a-210 c, 212 a-212 c, 216 a-216 c, and 224 a-224 c are now generally described with reference to FIG. 4. Each of these clock gate circuits 210 a-210 c, 212 a-212 c, 216 a-216 c, and 224 a-224 c includes its own latch 250 a-250 c. The data input of the latches 250s correspond to the data inputs of the clock gate circuits 210 a-210 c, 212 a-212 c, 216 a-216 c, and 224 a-224 c, and the inverted enable inputs of the latches 250 a-250 c correspond to the enable inputs of the clock gate circuits 210 a-210 c, 212 a-212 c, 216 a-216 c, and 224 a-224 c. AND gates 252 a-252 c receive as input the outputs of the latches 250 a-250 c as well as the non-inverted inputs to the enable inputs of the latches 250 a-250 c. The outputs of the AND gates 252 a-252 c correspond to the outputs of the clock gate circuits 210 a-210 c, 212 a-212 c, 216 a-216 c, and 224 a-224 c.

Operation of the clock generation circuits 200 a-200 c will now be described. Initially, the clock generation circuits 200 a-200 c operate in a reset phase. In the reset phase, the Set signal is pulsed, setting the outputs of the flip flops 204 a-204 c, 206 a-206 c, 220 a-220 c. When the ATPG Mode signal is asserted, indicating entry of the device 99 into ATPG mode, the PLL Clock signal is deasserted, and the ATE forces the shift clock to deassert. Since OR gates 208 a-208 c are receiving an asserted signal from flip flop 206 a-206 c at this point, clock gates 210 a-210 c pass the shift clock through to OR gates 214 a-214 c, and the clock signals PBSU CLK follows shift clock. The state machines 218 a-218 c then generate the enable signals PBSU Enable as being deasserted, thereby de-enabling the clock gate circuits 224 a-224 c.

The ATE then asserts the Scan Enable signal. At this point, shift clock, the Stuck-at ATPG signal, the clock signals PBSU CLK, and the enable signals PBSU Enable remain deasserted. Due to assertion of the Scan Enable signal, output of the OR gates 208 a-208 c remain asserted, and clock gate circuits 210 a-210 c remain as passing shift clock. After waiting a sufficient period of time for the PLL Clock signal to lock, the ATE deasserts the Scan Enable signal.

As a result, the outputs of OR gates 202 a-202 c are deasserted. It follows then that, within three cycles of the PLL Clock signal, the outputs of the flip flops 206 a-206 c are deasserted, resulting in the output of the OR gates 208 a-208 c being deasserted, the clock gate circuits 210 a-210 c blocking the shift clock signal, and the clock gate circuits 212 a-212 c passing the PLL clock signal, PLL clock signal/2, and PLL clock signal/4. The OR gates 214 a-214 c pass the PLL clock signal, PLL clock signal/2, and PLL clock signal/4 as the clock signals PBSU Clk to the clock gate circuits 216 a-216 c.

Thereafter, the state machines 218 a-218 c causes the flip flops 220 a-220 c to deassert their outputs. This ultimately serves to cause the outputs of the flip flops 206 a-206 c to be asserted, resulting in the OR gates 208 a-208 c asserting their outputs to cause the clock gate circuits 212 a-212 c to block the PLL Clock signal, PLL Clock Signal/2, and PLL Clock Signal/4, and to cause the clock gate circuits 210 a-210 c to pass the Shift Clock signal. The Shift Clock signal is passed through the OR gates 214 a-214 c, through clock gate circuits 216 a-216 c, and to the state machines 218 a-218 c and clock gates 224 a-224 c. During the reset phase, state machines 218 a-218 c keep the control signals PBSU Enable deasserted, as well as keeping scan enable and stuck-at ATPG both deasserted, thereby causing shift clock to be blocked at clock gates 224 a-224 c.

The reset phase is now complete, and shift mode begins. In shift mode, the ATE asserts Scan Enable and pulses Shift Clock, and the state machines 218 a-218 c cause the flip flops 220 a-220 c to assert their outputs, and load internal registers with a number equal to a number of clock cycles to be used during capture mode. When scan_enable=‘1’, shift clock is allowed to pass through clock gates 224 a-224 c and is available as the ATPG clock[n] outputs. Shift Clock is then pulsed the requisite number of times for use by the device 99 to shift data in and out of ATPG scan chains.

Capture mode is then entered, and the ATE deasserts Scan Enable, resulting in the OR gates 202 a-202 c deasserting their outputs, and thus the flip flops 206 a-206 c deasserting their outputs, and the consequential passing of PLL clock, PLL clock/2, and PLL clock/4 by clock gate circuits 212 a-212 c and blocking of Shift Clock by clock gate circuits 210 a-210 c. Resultingly, the PLL clock, PLL clock/2, and PLL clock/4 is passed through OR gates 214 a-214 c as clock signals PBSU Clk. The state machines 218 a-218 c then pulse the enable signals PBSU Enable a number of times equal to the number stored in the internal shift registers, resulting in the clock gate circuits 224 a-224 c generating a number of ATPG clock pulses equal to that number.

Shift mode and capture mode may be repeated a suitable number of times so as to effectuate the desired ATPG testing.

The combination of the clock selection circuit 100 and clock generation circuits 200 a-200 c provide for glitch free clock selection and switchover between output of the functional clock to output of the LBIST clock and vice versa, and between different clock speeds during ATPG mode. In addition, the combination of the clock selection circuit 100 and clock generation circuits 200 a-200 c provide for a 50% duty cycle for each of these various possible clock outputs.

Shown in FIG. 6 is a timing diagram of operation of the ATPG clock generation circuits 200 a-200 c.

The foregoing description has provided by way of exemplary and non-limiting examples a full and informative description of the exemplary embodiment of this invention. However, various modifications and adaptations may become apparent to those skilled in the relevant arts in view of the foregoing description, when read in conjunction with the accompanying drawings and the appended claims. However, all such and similar modifications of the teachings of this invention will still fall within the scope of this invention as defined in the appended claims. 

The invention claimed is:
 1. A test circuit operable in an automatic test pattern generation (ATPG) mode and a logic built-in self-test (LBIST) mode, the test circuit comprising: a clock selection circuit comprising: clock logic circuitry configured to receive an LBIST mode signal and an ATPG mode signal and to generate an indication of whether the test circuit is operating in either the ATPG mode or the LBIST mode; a multiplexing circuit configured to receive an ATPG clock and a functional clock as input and output a selected one of the ATPG clock and the functional clock; and a clock gate circuit enabled in response to enable signals, wherein the enable signals are an inverse of a selected one of the ATPG clock and the functional clock, the clock gate circuit receiving the indication of whether the test circuit is operating in either the ATPG mode or the LBIST mode and configured to generate a test clock as a function of the indication.
 2. The test circuit of claim 1, wherein the clock logic circuitry comprises: a clock logic circuitry OR gate configured to receive the LBIST mode signal and the ATPG mode signal and generate a clock logic circuitry OR gate output; and a clock logic circuitry AND gate configured to receive a functional clock enable signal and an inverse of the clock logic circuitry OR gate output.
 3. The test circuit of claim 1, further comprising a clock generation circuit configured to generate the ATPG clock, wherein the clock generation circuit is operable in a reset phase, a shift mode, and a capture mode, the clock generation circuit comprising: a first circuit configured to perform a reset sequence in the reset phase, pass a shift clock for use in the shift mode, and to pass a PLL clock for use in the capture mode.
 4. The test circuit of claim 3, wherein the first circuit comprises: a first circuit first OR gate configured to receive a stuck-at ATPG signal, a scan enable signal and a shift clock pass signal and generate a first OR output; a third clock gate circuit having a third clock gate data input configured to receive the first OR output and a third clock gate enable input configured to receive the shift clock, the third clock gate circuit further configured to generate a third clock gate output; a fourth clock gate circuit having a fourth clock gate data input configured to receive an inverse of the first OR output and a fourth clock gate enable input configured to receive the PLL clock, the fourth clock gate circuit configured to generate a fourth clock gate output; and a first circuit second OR gate configured to receive the third and fourth clock gate outputs.
 5. The test circuit of claim 4, wherein the stuck-at ATPG signal indicates that the clock generation circuit is to test for stuck-at faults; and wherein the scan enable signal indicates whether the clock generation circuit is in the shift mode or the capture mode.
 6. The test circuit of claim 4, wherein the ATPG mode signal represents an output of a logical OR between the stuck-at ATPG signal and an at-speed ATPG signal; and wherein the at-speed ATPG signal indicates that the clock generation circuit is to test for timing faults.
 7. A test circuit operable in an automatic test pattern generation (ATPG) mode and a logic built-in self-test (LBIST) mode, the test circuit comprising: a clock selection circuit comprising: clock logic circuitry configured to receive as input an LBIST mode signal and an ATPG mode signal, and to generate first and second outputs therefrom, the first output being in a first logic state when the test circuit is operating in either the ATPG mode or the LBIST mode, the second output being in a second logic state when the test circuit is operating in either ATPG mode or LBIST mode; a multiplexing circuit configured to receive an ATPG clock and a functional clock as input and output a selected one of the ATPG clock and the functional clock; and a clock gate circuit enabled in response to enable signals, wherein the enable signals are an inverse of a selected one of the ATPG clock and the functional clock, the clock gate circuit configured to receive the second outputs from the clock logic circuitry and provide clock gate circuit outputs; wherein the clock gate circuit is configured to generate a test clock as a function of a logical operation performed on the clock gate circuit outputs.
 8. The test circuit of claim 7, wherein the clock logic circuitry comprises: a clock logic circuitry OR gate configured to receive the LBIST mode signal and the ATPG mode signal and generate a clock logic circuitry OR gate output; and a clock logic circuitry AND gate configured to receive a functional clock enable signal and an inverse of the clock logic circuitry OR gate output of the clock logic circuitry OR gate as input and generate the first output.
 9. The test circuit of claim 7, wherein the LBIST mode signal is generated by a self-test control unit.
 10. The test circuit of claim 7, further comprising a clock generation circuit configured to generate the ATPG clock, wherein the clock generation circuit is operable in a reset phase, a shift mode, and a capture mode, the clock generation circuit comprising: a first circuit configured to perform a reset sequence in the reset phase, pass a shift clock for use in the shift mode and pass a PLL clock for use in the capture mode; a first clock gate circuit configured to receive the passed shift clock or the passed PLL clock and the ATPG mode signal and output a clock gate output signal; and a second circuit configured to generate the ATPG clock as a function of the clock gate output signal.
 11. The test circuit of claim 10, wherein the first circuit comprises: a first circuit first OR gate configured to receive a stuck-at ATPG signal, a scan enable signal and a shift clock pass signal and generate a first OR output; a third clock gate circuit having a third clock gate data input configured to receive the first OR output and a third clock gate enable input configured to receive the shift clock, the third clock gate circuit configured to generate a third clock gate output; a fourth clock gate circuit having a fourth clock gate data input configured to receive an inverse of the first OR output and a fourth clock gate enable input configured to receive the PLL clock, the fourth clock gate circuit configured to generate a fourth clock gate output; and a first circuit second OR gate configured to receive the third and fourth clock gate outputs and generate an output to a first clock gate circuit enable input of the first clock gate circuit.
 12. The test circuit of claim 11, wherein the stuck-at ATPG signal indicates that the clock generation circuit is to test for stuck-at faults; and wherein the scan enable signal indicates whether the clock generation circuit is in the shift mode or the capture mode.
 13. The test circuit of claim 11, wherein the ATPG mode signal represents an output of a logical OR between the stuck-at ATPG signal and an at-speed ATPG signal; and wherein the at-speed ATPG signal indicates that the clock generation circuit is to test for timing faults.
 14. The test circuit of claim 11, wherein the first clock gate circuit receives the ATPG mode signal at its data input.
 15. A method of operating a test circuit, comprising: generating first and second outputs from an LBIST mode signal and an ATPG mode signal, the first output having a first logic state when the test circuit is operating in either an ATPG mode or a LBIST mode, the second output having a second logic state when the test circuit is operating in either the ATPG mode or the LBIST mode; receiving an ATPG clock and a functional clock; outputting a selected one of the ATPG clock and the functional clock; enabling a first latch as a function of an inverse of the selected one of the ATPG clock and the functional clock, and latching the second output as a first latch output; enabling a second latch as a function of the inverse of the selected one of the ATPG clock and the functional clock, and latching the first output as a second latch output; generating a first AND gate output as a function of a logic AND operation performed on the first latch output and the selected one of the ATPG clock and the functional clock; generating a second AND gate output as a function of a logical AND operation performed on the second latch output and the selected one of the ATPG clock and an LBIST clock; and generating a test clock as a clock gate OR gate output as a function of a logical OR operation performed on the first AND gate output and the second AND gate output.
 16. The method of claim 15, wherein the generation of the first and second outputs from the LBIST mode signal and the ATPG mode signal is performed by: generating a clock logic circuitry OR gate output as a function of a logical OR operation performed the LBIST mode signal and the ATPG mode signal; and generating the first output as a function of a logical AND operation performed on a functional clock enable signal and an inverse of the clock logic circuitry OR gate output.
 17. The method of claim 15, further comprising generating the LBIST mode signal using a self-test control unit. 